//
//  NeedPurchaseViewController.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/12.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "NeedPurchaseViewController.h"
#import "NeedPurchaseViewModel.h"
#import "SpeedPurchaseViewController.h"
#import "PicturePurchaseViewController.h"
#import "EntrustPurchaseViewController.h"

@interface NeedPurchaseViewController ()<NeedPurchDelegate>
@property (nonatomic,strong) NeedPurchaseViewModel * needViewModel;
@end

@implementation NeedPurchaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我要求购";
    self.needViewModel = [[NeedPurchaseViewModel alloc] initWithViewToViewModel:self.tableView theSuperView:self.view];
    self.needViewModel.delegate = self;
}

#pragma mark --- NeedPurchDelegate
-(void)indexPushIndex:(NSIndexPath *)pathDex{
    switch (pathDex.row) {
        case 0:
        case 1:
        case 2:{
            SpeedPurchaseViewController * speedVc = [SpeedPurchaseViewController new];
            if (pathDex.row == 0) {
                speedVc.p_type = PurchaseType_Ordinary;
            }else if (pathDex.row == 1){
                speedVc.p_type = PurchaseType_Deposit;
            }else{
                speedVc.p_type = PurchaseType_Long;
            }
            [self.navigationController pushViewController:speedVc animated:YES];
        }
            break;
        case 3:{
            PicturePurchaseViewController * pictureVC = [PicturePurchaseViewController new];
            [self.navigationController pushViewController:pictureVC animated:YES];
        }
            break;
        case 4:{
            EntrustPurchaseViewController * entrusVC = [EntrustPurchaseViewController new];
            [self.navigationController pushViewController:entrusVC animated:YES];
        }
            break;
            
        default:
            break;
    }
}
@end
